<?php

/**
 * IndexController - The default controller class
 * 
 * @author Fernando Dias Oliveira
 * @version 1.0
 */

class ExportController extends AppBaseController
{
	private $data;
	private $class;

	public function init()
	{
		$this->data = date("d_m_Y");
		$this->class = $this->_request->getParam("class");
	}

    public function excelAction() 
    {
    	/*		header("Content-type: application/msexcel");
		header("Content-Disposition: attachment; filename=$this->nome_arquivo");
    	$this->view->export = true;
    	
    	$export = new Exportfile("doc_$this->data.xls", $this->_request->getPost("p"));
    	
    	$export->excel();*/
    	
    	$this->grid($this->_request->getParam("class"));
    	
    	$this->_helper->layout->disableLayout();
    	//echo ;
    	//exit;
    }    
    
    public function pdfAction() 
    {
    	$this->view->export = true;
    	
    	$export = new Exportfile("doc_$this->data.xls", $this->grid("PRD02"));
    	
    	$export->pdf();
    	
    	$this->_helper->layout->disableLayout();
    }    
}
